package com.liucxu.qiushimeinv.Model.Impl;

import android.text.TextUtils;

import com.liucxu.qiushimeinv.Api.GirlsService;
import com.liucxu.qiushimeinv.Model.Bean.GirlsBean;
import com.liucxu.qiushimeinv.Model.IGirlsModel;
import com.liucxu.qiushimeinv.Utils.PreferenceUtils;
import com.liucxu.qiushimeinv.Utils.ServiceFactory;

import java.util.HashMap;

import rx.Observable;

/**
 * 获取美女列表的Model实现类
 * Created by liukanshan on 2017/1/1.
 */

public class GirlsModelImpl implements IGirlsModel {
    @Override
    public Observable<GirlsBean> getGirls(String pageNum) {
        HashMap<String, String> values = new HashMap<>();
        values.put("task", "mmFlow");
        values.put("pageNum", pageNum);
        if (!TextUtils.isEmpty(PreferenceUtils.GetUserToken())) {
            values.put("token", PreferenceUtils.GetUserToken());
        }
        return ServiceFactory.GetInstance().createService(GirlsService.class).getGirls(values);
    }
}
